﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

#if _WIN64
using int_t = System.Int64;
#else
using int_t = System.Int32;
#endif

namespace DZJIFC.Model
{
    public class AP242Instance : IInstance
    {
        #region Fields

        private int_t _iID;
        private AP242Product _product;
        _matrix4x4 _transformation;

        #endregion // Fields

        #region Methods

        public AP242Instance(int_t iID, AP242Product product, _matrix4x3? transformation)
        {
            _iID = iID;
            _product = product;

            if (transformation != null)
            {
                _transformation = _matrix4x4.To4x4(transformation);
            }
        }

        #endregion // Methods

        #region Properties
        public string UniqueName => string.Format("#{0} {1}", _product.ExpressID, IModelStructureView.ITEM_INSTANCE);

        #region IInstance

        public int_t ID => _iID;
        public Geometry Geometry => _product;
        public _matrix4x4 Transformation => _transformation;
        public bool Enabled { get; set; } = true;
        public IUIItem UIItem { get; set; }

        #endregion // IInstance

        #endregion // Properties
    }
}
